<div class="bjui-pageContent">
    <table class="table table-bordered" id="deviceinfo" data-toggle="datagrid" data-options="{
        height: '100%',
        local: 'remote',
        showToolbar: true,
        postData:{sn:'${sn}'},
        dataUrl: '/sysmanage/deviceConfig/listdata.do',
        paging: {pageSize:20, pageCurrent:1},
        linenumberAll: false,
        filterThead:false,
        inlineEditMult:false,
        sortAll: false
    }">
        <thead>
        <tr>
            <th data-options="{name:'sn',align:'center'}" width="200px">sn</th>
            <th data-options="{name:'reportCycle',align:'center'}" width="150px">上报周期</th>
            <th data-options="{name:'reportResult',align:'center',type:'select',items:[{0:'失败'},{1:'成功'}]}"
                width="130px">结果
            </th>
            <th data-options="{name:'sampleCycle',align:'center'}" width="150px">采样周期</th>
            <th data-options="{name:'sampleResult',align:'center',type:'select',items:[{0:'失败'},{1:'成功'}]}"
                width="130px">结果
            </th>
            <th data-options="{name:'upper',align:'center'}" width="150px">水位上限</th>
            <th data-options="{name:'upperResult',align:'center',type:'select',items:[{0:'失败'},{1:'成功'}]}"
                width="130px">结果
            </th>
            <th data-options="{name:'lower',align:'center'}" width="150px">水位下限</th>
            <th data-options="{name:'lowerResult',align:'center',type:'select',items:[{0:'失败'},{1:'成功'}]}"
                width="130px">结果
            </th>
            <th data-options="{align:'center',render:'setcreatedate'}" width="240px">设置时间</th>
        </tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function setDeviceName(value, data) {
        if (data.deviceByDevicesn != null) {
            return data.deviceByDevicesn.devicename;
        }
    }
    function setUserName(value, data) {
        if (data.deviceByDevicesn != null) {
            if (data.deviceByDevicesn.deviceownerByOwnerid != null) {
                return data.deviceByDevicesn.deviceownerByOwnerid.name;
            }
        }
        return "";
    }
    function setLocation(value, data) {
        if (data.deviceByDevicesn != null) {
            return data.deviceByDevicesn.location;
        }

    }
    function setDeviceModel(value, data) {
        if (data.deviceByDevicesn != null) {
            return data.deviceByDevicesn.devicemodel;
        }
    }
    function setcreatedate(value, data) {
        return formatDate(new Date(data.createdate));
    }
</script>